﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace Toybox.NicoSharp.ConsoleTester
{
	using CookieGetterSharp;

	class Program
	{
		static void Main(string[] args)
		{

			Logger.TraceLogger.Enable = true;
			Logger.DebugLogger.Enable = true;

			ICookieGetter iCookieGetter = CookieGetter.CreateInstance(BrowserType.GoogleChrome);

			NetworkState.Cookies = new CookieCollection();
			NetworkState.Cookies.Add(
				iCookieGetter.GetCookie(new Uri(NicoUrls.VideoTop), "user_session"));

			//CheckList cl = CheckList.Get();

			Live.Alert.AlertClient client = new Live.Alert.AlertClient();

			client.RecvAlertStatus += client_RecvAlertStatus;
			client.RecvLiveInfo += client_RecvLiveInfo;

			client.Start(100);

		}

		static void client_RecvLiveInfo(object sender, Live.Alert.LiveInfo e)
		{
			Console.WriteLine("{0},{1},{2}", e.Live, e.User, e.Com);
		}

		static void client_RecvAlertStatus(object sender, Live.Alert.AlertStatus e)
		{
			Console.WriteLine(e.status + e.user_id);
		}
	}
}
